﻿package mortal.game.view.mainUI.smallMap.view.typeIconDataParser
{
    import Message.BroadCast.*;
    import mortal.component.gconst.*;
    import mortal.game.cache.*;
    import mortal.game.resource.*;
    import mortal.game.scene3D.layer3D.utils.*;
    import mortal.game.scene3D.player.entity.*;
    import mortal.game.view.mainUI.smallMap.view.data.*;

    public class SmallMap_TreasureHuntParser extends Object implements ISMallMapTyperIconDataParser
    {
        public static var instance:SmallMap_TreasureHuntParser = new SmallMap_TreasureHuntParser;

        public function SmallMap_TreasureHuntParser()
        {
            return;
        }// end function

        public function chooseIcon(param1:IEntity, param2:Array) : void
        {
            var _loc_6:SBuffInfo = null;
            var _loc_3:* = param1.entityInfo.entityInfo;
            var _loc_4:* = new SmallMapTypeIconData();
            _loc_4.x = param1.x2d;
            _loc_4.y = param1.y2d;
            _loc_4.name = "";
            _loc_4.tips = _loc_3.name;
            _loc_4.iconName = ImagesConst.MapPoint_greenPoint;
            var _loc_5:* = Cache.instance.role.entityInfo;
            if (EntityUtil.equal(_loc_3.entityId, _loc_5.entityId))
            {
                return;
            }
            if (_loc_3.code == GameConst.TreasureZijinBossCode)
            {
                _loc_4.iconName = ImagesConst.MapPoint_MovePoint;
            }
            if (_loc_3.code == GameConst.TreasureHuangjinBossCode)
            {
                _loc_4.iconName = ImagesConst.BossDrop_8;
            }
            if (param1 is UserPlayer)
            {
                for each (_loc_6 in param1.entityInfo.entityInfo.buffInfos)
                {
                    
                    if (_loc_6.buffId == GameConst.TreasureZijinBoxBuffId)
                    {
                        _loc_4.iconName = ImagesConst.MapPoint_MovePoint;
                    }
                    if (_loc_6.buffId == GameConst.TreasureHuangjinBoxBuffId)
                    {
                        _loc_4.iconName = ImagesConst.BossDrop_8;
                    }
                }
            }
            param2.push(_loc_4);
            return;
        }// end function

    }
}
